package io.nanfeng.scope

import java.util.logging.Logger

@JvmInline value class Context<T> @PublishedApi internal constructor(@PublishedApi internal val _value: Any)

inline fun <T> Context(value: T, unit: Unit = Unit): Context<T> = Context<Any>(value as Any) as Context<T>

context(Context<A>) inline fun <A> given(): A= this@Context._value as A

context(Context<Logger>)
fun foo() {
    val logger: Logger = given()
}